using System;
using System.Collections.Generic;
using System.Text;
using Barrage;
using Spacedash.Logic.Scenario;
using Spacedash.Game.Cameras;
using Barrage.Global;
using SlimDX;
using Barrage.Elements;
using Barrage.Items;
using Spacedash.Game.Nodes;
using Barrage.Audios;

namespace Spacedash.Game.Scenes
{
    class CreditsScene : Scene
    {
        Scenario scenario;
        ScenarioNode scenarioItem;
        JukeboxItem jukebox;


        public CreditsScene(Scenario scenario)
        {
            this.scenario = scenario;
            addDefaultElements(); 
            loadScenario();
            Camera = new CreditsCamera(scenario, new Vector2(Engine.DefaultRenderTargetDescription.Width, Engine.DefaultRenderTargetDescription.Height));
            Add(Camera);
           
        }

        void addDefaultElements()
        {
            Light l = new Light(new Color3(1, 0, 0));
            l.Motion.Translation = new Vector3(100, 100, 100);
            l.Attenuation = new Vector3(1, 0.01f, 0);
            l.Specular = new Color3(1, 0, 0);
            addLight(l);


            Item i = new Skybox("Cube.dds");
            i.Motion.Scale = new Vector3(100);
            /*StreamAudio audio = new StreamAudio(Store.PathConfig[Store.MUSIC_PATH] + "01 - Running with the wind.ogg");
            audio.Loop = true;
            audio.Start();
            audio.Volume = 1;
            i.addAudio(audio);*/
            Add(i);

        }

        void loadScenario()
        {
            scenarioItem = new ScenarioNode(scenario);
            Add(scenarioItem);
            
            jukebox = new JukeboxItem(Store.PathConfig[Store.MUSIC_PATH] + "01 - Running with the wind.ogg");
            Add(jukebox);
        }

        public override void Dispose()
        {
            scenario = null;
            scenarioItem = null;
            jukebox = null;
            base.Dispose();
        }
        
    }
}
